package models

type Pic struct {
	PicId int
	Type int
	ItemId int
	Path string
	PicType string
	Size int
	Extension string
	Status int
	CreateTime string
}

var PicType = map[int]string {
	1: "电影",
	2: "电视剧",
	3: "纪录片",
	4: "公开课",
	5: "资讯",
	6: "字幕",
	7: "影评",
	8: "头像",
}

var ResourceTypeList = map[string]int {
	"tv" : 2,
	"movie" : 1,
	"openclass" : 4,
}

func (Pic) TableName() string {
	return "pic"
}

type PicPath struct {
	Path string
} 
func GetPicByTypeItemId(TypeId int, ItemId int) (PicList []PicPath) {
	db.Table("pic").Where(Pic{Type:TypeId, ItemId:ItemId, Status:1}).Select("path").Scan(&PicList)
	return
}



